package com.spring.dao;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;
//以下四个注解作用完全相同，就是new对象
//产生对象 等同于<bean></bean>
//默认名称是：userDAO，也可以指定名称
//@Service用于service包的注解
//@Controller用于controller包的注解
//@Component
@Repository("udao")//用于dao包的注解
public class UserDAO {
    @Value("1")
    private Integer id;
    @Value("张三")
    private String name;

    public void print(){
        System.out.println("UserDAO的print方法!");
        System.out.println("id是:"+id);
        System.out.println("name是:"+name);
    }
}
